package com.hxzy.module.back.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hxzy.module.back.api.backaccount.resp.BackAccountResp;
import com.hxzy.module.back.entity.BackAccount;
import com.hxzy.module.back.mapstruct.BackMapStruct;
import com.hxzy.module.back.service.BackAccountService;
import com.hxzy.module.back.mapper.BackAccountMapper;
import org.apache.ibatis.annotations.Lang;
import org.springframework.stereotype.Service;

/**
* @author 11452
* @description 针对表【back_account(总部账户表)】的数据库操作Service实现
* @createDate 2024-01-26 14:05:00
*/
@Service
public class BackAccountServiceImpl extends ServiceImpl<BackAccountMapper, BackAccount>
    implements BackAccountService{

    /**
     * 根据账户查询信息
     * @param account
     * @return
     */
    @Override
    public BackAccountResp findByAccount(String account) {
        LambdaQueryWrapper<BackAccount> queryWrapper=new LambdaQueryWrapper<>();
        queryWrapper.eq(BackAccount::getAccount,account);
        BackAccount backAccount = this.getOne(queryWrapper);
        return BackMapStruct.INSTANCE.convert(backAccount);
    }
}




